<script setup>
import { useRouter } from "vue-router";
const router = useRouter()
const todemo = () => {
  router.push({ path: '/demo' })
}
const tohello = () => {
  router.push({ path: '/hello' })
}
</script>
<template>
  <div id="d1">
    <div id="d2">
      <router-link to="/demo">去 demo</router-link>
      <br>
      <router-link to="/hello">去 hello</router-link>
      <br>
      <button @click="todemo">去 demo</button>
      <br>
      <button @click="tohello">去 hello</button>
    </div>
    <div id="d3">
      <RouterView />
    </div>
  </div>
</template>
<style scoped>
#d1 {
  display: flex;
}
#d2 {
  width: 200px;
  height: 50px;
}
</style>
<!--组员写了点了代码-->